/// <summary>
/// The 'Product' abstract class
/// 产品抽象类
/// </summary>
public abstract class Product
{

}

/// <summary>
/// A 'ConcreteProduct' class
/// 具体实现类A
/// </summary>
class ConcreteProductA : Product
{

}

/// <summary>
/// B 'ConcreteProduct' class
/// 具体实现类B
/// </summary>
class ConcreteProductB : Product
{

}

/// <summary>
/// The 'Creator' abstract class
/// 创造抽象类
/// </summary>
abstract class Creator
{
    public abstract Product FactoryMethod();
}

/// <summary>
/// A 'ConcreteCreator' class
/// 具体实现类A
/// </summary>
class ConcreteCreateA : Creator
{
    public override Product FactoryMethod()
    {
        return new ConcreteProductA();
    }
}
/// <summary>
/// B 'ConcreteCreator' class
/// 具体实现类B
/// </summary>
class ConcreteCreateB : Creator
{
    public override Product FactoryMethod()
    {
        return new ConcreteProductB();
    }
}